package com.adaxi.adc.business.manager.controller;


import com.adaxi.adc.business.manager.pojo.Passenger;
import com.adaxi.adc.business.manager.pojo.PassengerTrip;
import com.adaxi.adc.business.manager.service.impl.PassengerServiceImpl;
import com.adaxi.adc.business.manager.service.impl.PassengerTripServiceImpl;
import com.adaxi.adc.common.common.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "乘客接口", value = "PassengerController")
@RestController
public class PassengerController {
    @Autowired
    PassengerServiceImpl passengerService;

    @Autowired
    PassengerTripServiceImpl passengerTripService;

//    @GetMapping("/passenger")
//    @ApiOperation(value = "乘客列表查询", notes = "乘客列表查询")
//    public CommonResult query(Long id){
//        List<Passenger> passenger=passengerService.passengerID(id);
//        return CommonResult.SUCCESS("查询成功",passenger);
//    }

    @GetMapping("/passenger/{id}")
    @ApiOperation(value = "根据id查询用户位置", notes = "根据id查询用户位置")
    public CommonResult queryByid(@PathVariable("id") Long id) {
        List<Passenger> passenger = passengerService.passengerid(id);
        return CommonResult.SUCCESS("查询成功", passenger);
    }
    @GetMapping("/passenger")
    @ApiOperation(value = "根据id查询用户位置", notes = "根据id查询用户位置")
    public CommonResult queryById() {
        List<Passenger> passenger = passengerService.list();
        return CommonResult.SUCCESS("查询成功", passenger);
    }

    @GetMapping("/passenger2/{id}")
    @ApiOperation(value = "根据id查询用户位置", notes = "根据id查询用户位置")
    public CommonResult query(@PathVariable("id") Long id) {
        List<PassengerTrip> passenger2 = passengerTripService.passengerTripid(id);
        return CommonResult.SUCCESS("查询成功", passenger2);
    }
}
